import  request from "@/utils/request"



//查询提交的商品可使用的优惠卷
export const couponListByOrder=(data)=>request({
    method:'post',
    url:`/mall/couponHistory/couponListByOrder`,
    data
})

//更具商品Id查询购物清单
export const getCartProductList=(ids)=>request({
    method:'get',
    url:`/mall/cartItem/getCartProduct?ids=${ids}`
})

//创建订单
export const createOrder=(data)=>request({
    method:'post',
    url:`/mall/order/createOrder`,
    data
})


//支付界面信息
export const getOrderList=(orderSn)=>request({
    method:'get',
    url:`/mall/order/getOrderList?orderSn=${orderSn}`
})

//余额支付
export const balancePay=(orderSn)=>request({
    method:'post',
    url:`/mall/order/balancePay?orderSn=${orderSn}`
})

//支付宝支付
export const aliPay=(orderSn)=>request({
    method:'post',
    url:`/order/pay?orderSn=${orderSn}`
})

//获取所有订单
export const getAllOrder=(status)=>request({
    method:'get',
    url:`/mall/order/list?status=${status}`
})

//修改状态
export const updateStatus=(id,status)=>request({
    method:'post',
    url:`/mall/order/updateStatus?id=${id}&status=${status}`
})

//删除订单
export const deleteOrder=(id)=>request({
    method:'delete',
    url:`/mall/order/delete/${id}`
})

//退货原因选择
export const getOrderReturnReasonList=()=>request({
    method:'get',
    url:`/mall/orderReturnReason`
})

//添加退货申请
export const addOrderReturnApply=(data)=>request({
    method:'post',
    url:`/mall/orderReturnApply/addOrderReturnApply`,
    data
})

//获取申请列表
export const getOrderReturnApplyList=(orderId,productId)=>request({
    method:'get',
    url:`/mall/orderReturnApply/getOrderReturnApply?orderId=${orderId}&productId=${productId}`
})

//修改退货申请
export const updateOrderReturnApply=(data)=>request({
    method:'put',
    url:`/mall/orderReturnApply/updateOrderReturnApply`,
    data
})